#include "junix.h"
using namespace std;

bool gt10(int i)
{
	return i>10;
}

int g()
{
	static int v=0;
	return v++;
}

int main(int argc, char **argv)
{
	vector<int> vi(20);
	generate(vi.begin(),vi.end(),g);
	copy(vi.begin(),vi.end(),
			ostream_iterator<int>(cout," "));
	cout<<endl;

	remove_copy_if(vi.begin(),vi.end(),
			ostream_iterator<int>(cout," "),
			ptr_fun(gt10));
	cout<<endl;

	remove_copy_if(vi.begin(),vi.end(),
			ostream_iterator<int>(cout," "),
			not1(ptr_fun(gt10)));
	cout<<endl;

}
